<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.thymeleaf.org/thymeleaf-extras-shiro">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>设备列表</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="favicon.ico">
    <link th:href="@{static/css/bootstrap.min.css}" href="../static/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link th:href="@{static/css/font-awesome.css}"href="../static/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link th:href="@{static/css/plugins/iCheck/custom.css}"href="../static/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link th:href="@{static/css/animate.css}"href="../static/css/animate.css" rel="stylesheet">
    <link th:href="@{static/css/style.css}"href="../static/css/style.css?v=4.1.0" rel="stylesheet">
    <link th:href="@{static/css/plugins/sweetalert/sweetalert.css}"href="../static/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">

</head>

<body class="gray-bg">


<div class="wrapper wrapper-content animated fadeInRight">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">

            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>设备列表</h5>
                            <label class="col-sm-2 control-label" th:text="${title.getMsg()}">共有：台设备</label>
                    </div>
                    <div class="ibox-content">
                        <div class="row">
                            <div class="col-sm-3">
                                <form th:action="@{/equipment_list}" method="post">
                                    <div id="main" style="width:1200px;">
                                        <div class="input-group"  style="width:200px;float:left;">
                                            <input type="text" placeholder="请输入设备名称" th:value="${query.name}"
                                                   class="form-control" id="searchname"
                                                   name="searchname"> <span class="input-group-btn"></span>
                                        </div>
                                        <div class="input-group"  style="width:200px;float:left;">
                                            <input type="text" placeholder="请输入编号" th:value="${query.number}"
                                                   class="form-control" id="searchnumb"
                                                   name="searchnumb"> <span class="input-group-btn"></span>
                                        </div>
                                        <div class="input-group"  style="width:200px;float:left;">
                                            <input type="text" placeholder="请输入设备类别" th:value="${query.cName}"
                                                   class="form-control" id="searchtype"
                                                   name="searchtype"> <span class="input-group-btn"></span>
                                        </div>
                                        <div class="input-group"  style="width:200px;float:left;">
                                            <input type="text" placeholder="使用状态" th:value="${query.status}"
                                                   class="form-control" id="searchstatus"
                                                   name="searchstatus"> <span class="input-group-btn"></span>
                                        </div>
                                        <button type="submit" class="btn btn-primary" id="search2"
                                                style="width:80px;float:left;"
                                        >搜索
                                        </button>

                                        <button shiro:hasPermission="1"type="button" class="btn btn-primary" data-toggle="modal"
                                                data-target="#addPersonnelModal" style="width:100px;float:left;">
                                            添加设备
                                        </button>
                                    </div>
                                </form>
                            </div>
                        </div>

                    </div>
                    <div class="table-responsive">
                        <table th:switch="${pageBean.list ne null and pageBean.list.size() gt 0}"
                               class="table table-striped">
                            <thead>
                            <tr>
                                <th width="10%" style="text-align: center">ID</th>
                                <th width="10%" style="text-align: center">名称</th>
                                <th width="10%" style="text-align: center">种类</th>
                                <th width="10%" style="text-align: center">价格</th>
                                <th width="15%" style="text-align: center">购买日期</th>
                                <th width="10%" style="text-align: center">编号</th>
                                <th width="15%" style="text-align: center">使用状况</th>
                                <th width="15%" style="text-align: center">主要参数</th>
                                <th width="15%" style="text-align: center">供应商</th>
                                <th shiro:hasPermission="1"width="15%" style="text-align: center">操作</th>
                            </tr>
                            </thead>
                            <tbody th:case="true">
                            <tr th:each="item:${pageBean.list}">
                                <td align="center" th:text="${item.id}">1</td>
                                <td align="center" th:text="${item.name}">杨伟东</td>
                                <td align="center" th:text="${item.cName}">男</td>
                                <td align="center" th:text="${item.price}">18888888888</td>
                                <td align="center" th:text="${item.buydate}">18888888888</td>
                                <td align="center" th:text="${item.number}">18888888888</td>
                                <td align="center" th:text="${item.status}">18888888888</td>
                                <td align="center" th:text="${item.parameter}">18888888888</td>
                                <td align="center" th:text="${item.sName}">18888888888</td>
                                <td align="center">
                                    <button shiro:hasPermission="1"class="btn btn-xs btn-danger" th:onclick="|deleteEquipment(${item.id})|"
                                            type="button"><i class="fa fa-warning"></i> <span class="bold">删除</span>
                                    </button>
                                    <button shiro:hasPermission="1" class="btn btn-xs btn-info " type="button" data-toggle="modal"
                                            data-target="#updatePersonnelModal" th:onclick="|update(${item.id})|">
                                        <i class="fa fa-paste"></i> 更新
                                    </button>
                                </td>
                            </tr>
                            <tbody th:case="false">
                            <tr>
                                <td align="center">暂无数据</td>
                                <td align="center">暂无数据</td>
                                <td align="center">暂无数据</td>
                                <td align="center">暂无数据</td>
                                <td align="center">暂无数据</td>
                                <td align="center">暂无数据</td>
                                <td align="center">暂无数据</td>
                                <td align="center">暂无数据</td>
                                <td align="center">暂无数据</td>
                                <td align="center">暂无数据</td>
                            </tr>
                            </tbody>
                            </tbody>
                        </table>
                        <div class="pull-right">
                            <script type="text/javascript">
                                function page(currentPage) {
                                    window.location.href = getRootPath() + "/equipment_list?currentPage="
                                        + currentPage;
                                }
                            </script>
                            <div class="pull-right" th:replace="share/page :: page">
                                <ul class="pagination">
                                    <li>
                                        < a href="#" aria-label="Previous">
                                        <span aria-hidden="true">&laquo;</span>
                                        </a>
                                    </li>
                                    <li><a href="#">1</a></li>
                                    <li><a href="#">2</a></li>
                                    <li><a href="#">3</a></li>
                                    <li><a href="#">4</a></li>
                                    <li><a href="#">5</a></li>
                                    <li>
                                        < a href="#" aria-label="Next">
                                        <span aria-hidden="true">&raquo;</span>
                                        </a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
<!--
添加模态框
-->
<div class="modal inmodal" id="addPersonnelModal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content animated fadeIn">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span
                        class="sr-only">Close</span></button>
                <h6 class="modal-title">添加设备</h6>
            </div>
            <div class="modal-body col-sm-12">
                <form class="form-horizontal" method="post" onsubmit="return addPerson(this);">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">设备名称</label>
                        <div class="col-sm-10">
                            <input type="text" placeholder="请输入设备名称" class="form-control" name="name" id="name3">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">设备种类</label>
                        <div class="col-sm-10">
                            <select name="class3" class="form-control" id="class3">
                                <option value="0">请选择...</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">供应商</label>
                        <div class="col-sm-10">
                            <select name="supplier3" class="form-control" id="supplier3">
                                <option value="0">请选择...</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">价格</label>
                        <div class="col-sm-10">
                            <input type="text" name="price3" id="price3" placeholder="请购买价格" class="form-control">
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 control-label">购买时间</label>
                        <div class="col-sm-10">
                            <input id="deadline3" name="deadline3" class="form-control layer-date" placeholder="YYYY-MM-DD"
                                   onclick="laydate({istime: true, format: 'YYYY-MM-DD'})">
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 control-label">编号</label>
                        <div class="col-sm-10">
                            <input type="text" placeholder="请输入编号" name="number3" class="form-control" id="number3">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">使用状况</label>
                        <div class="col-sm-10">
                            <input type="text" placeholder="请输入使用状况" name="status3" class="form-control" id="status3">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">主要参数</label>
                        <div class="col-sm-10">
                            <input type="text" placeholder="请输入主要参数" name="parameter3" class="form-control" id="parameter3">
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                        <button type="button" class="btn btn-primary" id="primary">保存</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<!--更新模态框-->
<div class="modal inmodal" id="updatePersonnelModal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content animated fadeIn">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span
                        class="sr-only">Close</span></button>
                <h6 class="modal-title">编辑设备信息</h6>
            </div>
            <div class="modal-body col-sm-12">
                <form class="form-horizontal" method="post" onsubmit="updateById(this)">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">设备名称</label>
                        <div class="col-sm-10">
                            <input type="text" placeholder="请输入设备名称" class="form-control" name="name1" id="name1">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">设备种类</label>
                        <div class="col-sm-10">
                            <select name="class1" class="form-control" id="class1">
                                <option value="0">请选择...</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">供应商</label>
                        <div class="col-sm-10">
                            <select name="supplier1" class="form-control" id="supplier1">
                                <option  value="0">请选择...</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">价格</label>
                        <div class="col-sm-10">
                            <input type="text" name="price1" id="price1" placeholder="请购买价格" class="form-control">
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 control-label">购买时间</label>
                        <div class="col-sm-10">
                            <input  id="deadline1" name="deadline1" class="form-control layer-date" placeholder="YYYY-MM-DD"
                                   onclick="laydate({istime: true, format: 'YYYY-MM-DD'})">
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 control-label">编号</label>
                        <div class="col-sm-10">
                            <input type="text" placeholder="请输入编号" name="number1" class="form-control" id="number1">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">使用状况</label>
                        <div class="col-sm-10">
                            <input type="text" placeholder="请输入使用状况" name="status1" class="form-control" id="status1">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">主要参数</label>
                        <div class="col-sm-10">
                            <input type="text" placeholder="请输入主要参数" name="parameter1" class="form-control" id="parameter1">
                        </div>
                    </div>
                    <div class="modal-footer">
                        <input type="hidden" id="id" name="id">
                        <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                        <button type="submit" class="btn btn-primary" id="save">
                            保存
                        </button>
                    </div>
                </form>
            </div>

        </div>
    </div>
</div>
<!-- 全局js -->
<script th:src="@{static/js/jquery.min.js}" src="../static/js/jquery.min.js?v=2.1.4"></script>
<script th:src="@{static/js/bootstrap.min.js}" src="../static/js/bootstrap.min.js?v=3.3.6"></script>


<!-- Peity -->
<script th:src="@{static/js/plugins/peity/jquery.peity.min.js}" src="../static/js/plugins/peity/jquery.peity.min.js"></script>

<!-- 自定义js -->
<script th:src="@{static/js/content.js}" src="../static/js/content.js?v=1.0.0"></script>


<!-- iCheck -->
<script th:src="@{static/js/plugins/iCheck/icheck.min.js}" src="../static/js/plugins/iCheck/icheck.min.js"></script>

<script th:src="@{static/script/base.js}" src="../static/script/base.js"></script>

<script th:src="@{static/script/tips.js}" src="../static/script/tips.js"></script>

<script th:src="@{static/script/equipment.js}" src="../static/script/equipment.js"></script>

<script th:src="@{static/js/plugins/sweetalert/sweetalert.min.js}" src="../static/js/plugins/sweetalert/sweetalert.min.js"></script>
<script th:src="@{static/js/plugins/laydate/laydate.js}" src="../static/js/plugins/laydate/laydate.js"></script>


<script>
    $(document).ready(function () {
        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_square-green',
            radioClass: 'iradio_square-green',
        });
    });

</script>
<script>
    lay('#version').html('-v'+ laydate.v);

    //执行一个laydate实例
    laydate.render({
        elem: '#deadline1' //指定元素
    });
</script>
<script>
    lay('#version').html('-v'+ laydate.v);

    //执行一个laydate实例
    laydate.render({
        elem: '#deadline3' //指定元素
    });
</script>
</body>

</html>
